/**
 * Copyright:Copyright(c)2014-2017
 * Company:厦门市易致达物联网科技有限公司
 * @version 1.0
 */
package shop.controller.front.voucherconvert;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import shop.core.FrontBaseController;
import shop.core.Services;
import shop.core.common.bean.JSONResult;
import shop.core.common.dao.page.PagerModel;
import shop.services.front.voucherconvert.VoucherconvertService;
import shop.services.front.voucherconvert.bean.Voucherconvert;
import shop.services.manage.system.bean.User;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.List;

/**   
 * @类名称：VoucherconvertController
 * @创建人：Wzl
 * @创建时间：2018-01-03 下午16:59:41      
 * @版本号：1.0
 * @描述：     
 */
@Controller
@RequestMapping("/front/voucherconvert/")
public class VoucherconvertController extends FrontBaseController<Voucherconvert> {
    @Resource
    private VoucherconvertService voucherconvertService;
    @Override
    public Services<Voucherconvert> getService() {
        return voucherconvertService;
    }

    /**
     * 查询兑换记录
     *
     * @return
     * @throws Exception
     */
    @RequestMapping("selectExchangeList")
    @ResponseBody
    public JSONResult selectExchangeList(HttpSession session, Voucherconvert voucherconvert){
        User user=(User)session.getAttribute("userInfo");
        voucherconvert.setUserID(user.getId());
        List<Voucherconvert> exchangeList = voucherconvertService.selectExchangeList(voucherconvert);
        JSONResult jsonResult = new JSONResult();
        jsonResult.setData(exchangeList);
        return jsonResult;
    }

    @Override
    public JSONResult deleteJson(HttpServletRequest request, Voucherconvert voucherconvert) throws Exception {
        return null;
    }
}
